/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cinema.client.cinemaclient.ui;

import com.cinema.client.cinemaclient.managers.ActorManager;
import com.cinema.client.cinemaclient.model.Actor;
import com.cinema.client.cinemaclient.tablemodels.ActorsTableModel;
import java.awt.BorderLayout;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTable;

/**
 *
 * @author Zsolt Szecsi
 */
public class ActorsFrame extends JFrame {
    
    public ActorsFrame() {
        super("Actors");
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BorderLayout());
        
        List<Actor> actors = (new ActorManager()).getAllActors();
        ActorsTableModel actorsTableModel = new ActorsTableModel(actors);
        JTable actorsTable = new JTable(actorsTableModel);
        
        mainPanel.add(actorsTable, BorderLayout.CENTER);
        this.setContentPane(mainPanel);
        this.setBounds(100, 100, 500, 300);
        
    }
}
